package com.xcc.commandpattern;

import com.xcc.commandpattern.demo02.CeilingFan;
import com.xcc.commandpattern.demo02.Command;

/**
 * @Description: CeilingFanOffCommand
 * @Author xiechuang
 * @Date 2022/9/8
 */
public class CeilingFanOffCommand implements Command {

    CeilingFan ceilingFan;

    public CeilingFanOffCommand(CeilingFan ceilingFan) {
        this.ceilingFan = ceilingFan;
    }

    @Override
    public void execute() {
        ceilingFan.off();
    }

    @Override
    public void undo() {
        ceilingFan.on();
    }

}
